\(\int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx\) [841]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 18, antiderivative size = 45 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\frac {1}{8} \sqrt {-1+x} x \sqrt {1+x}+\frac {1}{4} (-1+x)^{3/2} x (1+x)^{3/2}-\frac {\text {arccosh}(x)}{8} \]

[Out]

1/4*(-1+x)^(3/2)*x*(1+x)^(3/2)-1/8*arccosh(x)+1/8*x*(-1+x)^(1/2)*(1+x)^(1/2)

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {92, 38, 54} \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=-\frac {\text {arccosh}(x)}{8}+\frac {1}{4} (x-1)^{3/2} x (x+1)^{3/2}+\frac {1}{8} \sqrt {x-1} x \sqrt {x+1} \]

[In]

Int[Sqrt[-1 + x]*x^2*Sqrt[1 + x],x]

[Out]

(Sqrt[-1 + x]*x*Sqrt[1 + x])/8 + ((-1 + x)^(3/2)*x*(1 + x)^(3/2))/4 - ArcCosh[x]/8

Rule 38

Int[((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[x*(a + b*x)^m*((c + d*x)^m/(2*m + 1))
, x] + Dist[2*a*c*(m/(2*m + 1)), Int[(a + b*x)^(m - 1)*(c + d*x)^(m - 1), x], x] /; FreeQ[{a, b, c, d}, x] &&
EqQ[b*c + a*d, 0] && IGtQ[m + 1/2, 0]

Rule 54

Int[1/(Sqrt[(a_) + (b_.)*(x_)]*Sqrt[(c_) + (d_.)*(x_)]), x_Symbol] :> Simp[ArcCosh[b*(x/a)]/b, x] /; FreeQ[{a,
 b, c, d}, x] && EqQ[a + c, 0] && EqQ[b - d, 0] && GtQ[a, 0]

Rule 92

Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(a + b*x
)*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 3))), x] + Dist[1/(d*f*(n + p + 3)), Int[(c + d*x)^n*(e +
 f*x)^p*Simp[a^2*d*f*(n + p + 3) - b*(b*c*e + a*(d*e*(n + 1) + c*f*(p + 1))) + b*(a*d*f*(n + p + 4) - b*(d*e*(
n + 2) + c*f*(p + 2)))*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 3, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{4} (-1+x)^{3/2} x (1+x)^{3/2}+\frac {1}{4} \int \sqrt {-1+x} \sqrt {1+x} \, dx \\ & = \frac {1}{8} \sqrt {-1+x} x \sqrt {1+x}+\frac {1}{4} (-1+x)^{3/2} x (1+x)^{3/2}-\frac {1}{8} \int \frac {1}{\sqrt {-1+x} \sqrt {1+x}} \, dx \\ & = \frac {1}{8} \sqrt {-1+x} x \sqrt {1+x}+\frac {1}{4} (-1+x)^{3/2} x (1+x)^{3/2}-\frac {1}{8} \cosh ^{-1}(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 51, normalized size of antiderivative = 1.13 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\frac {1}{8} \left (x \sqrt {\frac {-1+x}{1+x}} \left (-1-x+2 x^2+2 x^3\right )-2 \text {arctanh}\left (\sqrt {\frac {-1+x}{1+x}}\right )\right ) \]

[In]

Integrate[Sqrt[-1 + x]*x^2*Sqrt[1 + x],x]

[Out]

(x*Sqrt[(-1 + x)/(1 + x)]*(-1 - x + 2*x^2 + 2*x^3) - 2*ArcTanh[Sqrt[(-1 + x)/(1 + x)]])/8

Maple [A] (verified)

Time = 1.45 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.16

method result size
default \(-\frac {\sqrt {-1+x}\, \sqrt {1+x}\, \left (-2 x^{3} \sqrt {x^{2}-1}+x \sqrt {x^{2}-1}+\ln \left (x +\sqrt {x^{2}-1}\right )\right )}{8 \sqrt {x^{2}-1}}\) \(52\)
risch \(\frac {x \left (2 x^{2}-1\right ) \sqrt {-1+x}\, \sqrt {1+x}}{8}-\frac {\ln \left (x +\sqrt {x^{2}-1}\right ) \sqrt {\left (-1+x \right ) \left (1+x \right )}}{8 \sqrt {-1+x}\, \sqrt {1+x}}\) \(53\)

[In]

int(x^2*(-1+x)^(1/2)*(1+x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/8*(-1+x)^(1/2)*(1+x)^(1/2)*(-2*x^3*(x^2-1)^(1/2)+x*(x^2-1)^(1/2)+ln(x+(x^2-1)^(1/2)))/(x^2-1)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 40, normalized size of antiderivative = 0.89 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\frac {1}{8} \, {\left (2 \, x^{3} - x\right )} \sqrt {x + 1} \sqrt {x - 1} + \frac {1}{8} \, \log \left (\sqrt {x + 1} \sqrt {x - 1} - x\right ) \]

[In]

integrate(x^2*(-1+x)^(1/2)*(1+x)^(1/2),x, algorithm="fricas")

[Out]

1/8*(2*x^3 - x)*sqrt(x + 1)*sqrt(x - 1) + 1/8*log(sqrt(x + 1)*sqrt(x - 1) - x)

Sympy [F]

\[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\int x^{2} \sqrt {x - 1} \sqrt {x + 1}\, dx \]

[In]

integrate(x**2*(-1+x)**(1/2)*(1+x)**(1/2),x)

[Out]

Integral(x**2*sqrt(x - 1)*sqrt(x + 1), x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.82 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\frac {1}{4} \, {\left (x^{2} - 1\right )}^{\frac {3}{2}} x + \frac {1}{8} \, \sqrt {x^{2} - 1} x - \frac {1}{8} \, \log \left (2 \, x + 2 \, \sqrt {x^{2} - 1}\right ) \]

[In]

integrate(x^2*(-1+x)^(1/2)*(1+x)^(1/2),x, algorithm="maxima")

[Out]

1/4*(x^2 - 1)^(3/2)*x + 1/8*sqrt(x^2 - 1)*x - 1/8*log(2*x + 2*sqrt(x^2 - 1))

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 70 vs. \(2 (31) = 62\).

Time = 0.29 (sec) , antiderivative size = 70, normalized size of antiderivative = 1.56 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=\frac {1}{24} \, {\left ({\left (2 \, {\left (3 \, x - 10\right )} {\left (x + 1\right )} + 43\right )} {\left (x + 1\right )} - 39\right )} \sqrt {x + 1} \sqrt {x - 1} + \frac {1}{6} \, {\left ({\left (2 \, x - 5\right )} {\left (x + 1\right )} + 9\right )} \sqrt {x + 1} \sqrt {x - 1} + \frac {1}{4} \, \log \left (\sqrt {x + 1} - \sqrt {x - 1}\right ) \]

[In]

integrate(x^2*(-1+x)^(1/2)*(1+x)^(1/2),x, algorithm="giac")

[Out]

1/24*((2*(3*x - 10)*(x + 1) + 43)*(x + 1) - 39)*sqrt(x + 1)*sqrt(x - 1) + 1/6*((2*x - 5)*(x + 1) + 9)*sqrt(x +
 1)*sqrt(x - 1) + 1/4*log(sqrt(x + 1) - sqrt(x - 1))

Mupad [B] (verification not implemented)

Time = 7.72 (sec) , antiderivative size = 362, normalized size of antiderivative = 8.04 \[ \int \sqrt {-1+x} x^2 \sqrt {1+x} \, dx=-\frac {\mathrm {atanh}\left (\frac {\sqrt {x-1}-\mathrm {i}}{\sqrt {x+1}-1}\right )}{2}+\frac {\frac {35\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^3}{2\,{\left (\sqrt {x+1}-1\right )}^3}+\frac {273\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^5}{2\,{\left (\sqrt {x+1}-1\right )}^5}+\frac {715\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^7}{2\,{\left (\sqrt {x+1}-1\right )}^7}+\frac {715\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^9}{2\,{\left (\sqrt {x+1}-1\right )}^9}+\frac {273\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^{11}}{2\,{\left (\sqrt {x+1}-1\right )}^{11}}+\frac {35\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^{13}}{2\,{\left (\sqrt {x+1}-1\right )}^{13}}+\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^{15}}{2\,{\left (\sqrt {x+1}-1\right )}^{15}}+\frac {\sqrt {x-1}-\mathrm {i}}{2\,\left (\sqrt {x+1}-1\right )}}{1+\frac {28\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^4}{{\left (\sqrt {x+1}-1\right )}^4}-\frac {56\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^6}{{\left (\sqrt {x+1}-1\right )}^6}+\frac {70\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^8}{{\left (\sqrt {x+1}-1\right )}^8}-\frac {56\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^{10}}{{\left (\sqrt {x+1}-1\right )}^{10}}+\frac {28\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^{12}}{{\left (\sqrt {x+1}-1\right )}^{12}}-\frac {8\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^{14}}{{\left (\sqrt {x+1}-1\right )}^{14}}+\frac {{\left (\sqrt {x-1}-\mathrm {i}\right )}^{16}}{{\left (\sqrt {x+1}-1\right )}^{16}}-\frac {8\,{\left (\sqrt {x-1}-\mathrm {i}\right )}^2}{{\left (\sqrt {x+1}-1\right )}^2}} \]

[In]

int(x^2*(x - 1)^(1/2)*(x + 1)^(1/2),x)

[Out]

((35*((x - 1)^(1/2) - 1i)^3)/(2*((x + 1)^(1/2) - 1)^3) + (273*((x - 1)^(1/2) - 1i)^5)/(2*((x + 1)^(1/2) - 1)^5
) + (715*((x - 1)^(1/2) - 1i)^7)/(2*((x + 1)^(1/2) - 1)^7) + (715*((x - 1)^(1/2) - 1i)^9)/(2*((x + 1)^(1/2) -
1)^9) + (273*((x - 1)^(1/2) - 1i)^11)/(2*((x + 1)^(1/2) - 1)^11) + (35*((x - 1)^(1/2) - 1i)^13)/(2*((x + 1)^(1
/2) - 1)^13) + ((x - 1)^(1/2) - 1i)^15/(2*((x + 1)^(1/2) - 1)^15) + ((x - 1)^(1/2) - 1i)/(2*((x + 1)^(1/2) - 1
)))/((28*((x - 1)^(1/2) - 1i)^4)/((x + 1)^(1/2) - 1)^4 - (8*((x - 1)^(1/2) - 1i)^2)/((x + 1)^(1/2) - 1)^2 - (5
6*((x - 1)^(1/2) - 1i)^6)/((x + 1)^(1/2) - 1)^6 + (70*((x - 1)^(1/2) - 1i)^8)/((x + 1)^(1/2) - 1)^8 - (56*((x
- 1)^(1/2) - 1i)^10)/((x + 1)^(1/2) - 1)^10 + (28*((x - 1)^(1/2) - 1i)^12)/((x + 1)^(1/2) - 1)^12 - (8*((x - 1
)^(1/2) - 1i)^14)/((x + 1)^(1/2) - 1)^14 + ((x - 1)^(1/2) - 1i)^16/((x + 1)^(1/2) - 1)^16 + 1) - atanh(((x - 1
)^(1/2) - 1i)/((x + 1)^(1/2) - 1))/2